<template>
  <div class="zuopin-detail">
    <w-nav-bar
      title="作品详情"/>
    <!--标题-->
    <h1
      class="w-text-center title"
      :class="{ 'w-text-bottom-line': model.url }">{{ model.name }}</h1>
    <!--版本-->
    <p class="version w-text-center">版本：{{ model.version }}</p>
    <!--时间-->
    <p class="time w-text-center">{{ model.strtAndEndTime }}</p>
    <!--说明-->
    <p class="describe w-text-center">{{ model.describe }}</p>
    <!--图片-->
    <ul class="pics">
      <li
        v-for="(item, k) in model.covers"
        :key="k">
        <img
          style="width: 100%"
          v-lazy="item">
      </li>
    </ul>
    <!--内容-->
    <w-marked-parsing :datastr="model.content"/>
  </div>
</template>

<script>
  import ProductModel from '@/models/web/ProductModel'
  import WMarkedParsing from '@/components/global/marked/parsing'

  export default {
    name: 'MeZuopinDetail',
    data() {
      return {
        /**
         * 作品模型
         */
        model: new ProductModel ()
      }
    },
    components: {
      WMarkedParsing
    },
    methods: {
      /**
       * 获取单个数据
       */
      getData() {
        this.model._id = this.$route.query.id
        this.model.getDetail ().w_then()
      }
    },
    mounted() {
      this.getData ()
    }
  }
</script>

<style lang="scss" scoped>
  .zuopin-detail {
    padding: 10px;

    > .title {
      font-size:20px;
      color: #333333;
    }

    > .version, > .time {
      font-size: 14px;
      color: #999;
    }

    > .describe {
      font-size: 16px;
      color: #666;
      line-height: 22px;
    }

    > .pics {
      list-style: none;
      margin: 0;
      padding: 10px;

      img {
        background-color: rgba(3, 3, 3, .1);
      }
    }
  }
</style>
